<?php

namespace Ue\Http\Controllers;

use Illuminate\Http\Request;

use Ue\Http\Requests;
use Ue\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;
use Gregwar\Captcha\CaptchaBuilder;

class HomeController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return Response
     */
    public function index()
    {
        $user   = Auth::loginUsingId(1);
    }
    
    public function captcha() {
        $builder = new CaptchaBuilder;
        $builder->build(100, 30);
        \Session::set('captcha', $builder->getPhrase()); //存储验证码
        return response($builder->output())->header('Content-type', 'image/jpeg');
    }
}
